<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:h="http://java.sun.com/jsf/html">
    <div class="ui-g">
        <div class="ui-g-12"><h3><b>甲方贷款类型</b></h3></div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.loanType}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.FIRST_PARTY_LOAN_TYPE]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
        <div class="ui-g-12">
            <h3><b>用户身份标签</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.identity}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.IDENTITY_TAG]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
        <div class="ui-g-12">
            <h3><b>信用卡标签</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.credit}" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.CREDIT_CARD_TAG]}" var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
        <div class="ui-g-12"><h3><b>借款基础信息</b></h3></div>
        <div class="ui-g-2"><p:outputLabel for="rateType" value="利率模式"/></div>
        <div class="ui-g-4">
            <p:selectOneMenu id="rateType" value="#{firstPartyTagInfoBean.$.rateType}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <p:ajax event="change" process="@form" update="@form"/>
                <f:selectItems
                        value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.RATE_TYPE]}"
                        var="dic"
                        itemLabel="#{dic.name}"
                        itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>
        <div class="ui-g-2"><p:outputLabel for="loanSpeed" value="最快放款时间"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="loanSpeed" value="#{firstPartyTagInfoBean.$.loanSpeed}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">天</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="minLimit" value="最低借款额度"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="minLimit" value="#{firstPartyTagInfoBean.$.minLimit}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">元</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="maxLimit" value="最高借款额度"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="maxLimit" value="#{firstPartyTagInfoBean.$.maxLimit}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">元</span>
            </div>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="defaultAmount" value="默认借款额度"/>
        </div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="defaultAmount" value="#{firstPartyTagInfoBean.$.defaultAmount}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">
                    <h:outputText value="元"/>
                </span>
            </div>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="defaultTime" value="默认借款期限"/>
        </div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="defaultTime" value="#{firstPartyTagInfoBean.$.defaultTime}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="minTerm" value="最短借款期限"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="minTerm" value="#{firstPartyTagInfoBean.$.minTerm}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="maxTerm" value="最长借款期限"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="maxTerm" value="#{firstPartyTagInfoBean.$.maxTerm}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>
        <div class="ui-g-12">
            <h3><b>借款所需资料</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.loanNecessaryData}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.LOAN_NECESSARY_DATA]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
        <div class="ui-g-12"><h3><b>资料准入门槛</b></h3></div>
        <div class="ui-g-2"><p:outputLabel for="minAge" value="最小年龄"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="minAge" value="#{firstPartyTagInfoBean.$.minAge}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">岁</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="maxAge" value="最大年龄"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="maxAge" value="#{firstPartyTagInfoBean.$.maxAge}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">岁</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="phoneOnlineTime" value="手机最低入网时长"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="phoneOnlineTime" value="#{firstPartyTagInfoBean.$.phoneOnlineTime}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">月</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="sesameCredit" value="最低芝麻信用分"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="sesameCredit" value="#{firstPartyTagInfoBean.$.sesameCredit}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">分</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="contacts" value="最低通讯录人数"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="contacts" value="#{firstPartyTagInfoBean.$.contacts}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">人</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="needCreditCard" value="是否需要信用卡"/></div>
        <div class="ui-g-4">
            <p:inputSwitch id="needCreditCard"
                           value="#{firstPartyTagInfoBean.$.needCreditCard}"
                           offLabel="否"
                           onLabel="是" disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>
        <div class="ui-g-12">
            <h3>
                <b>营销基础信息</b>
            </h3>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="modelId" value="活动模板"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="modelId" value="#{firstPartyTagInfoBean.$.modelId}" filter="true"
                             filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                <f:selectItems value="#{firstPartyTagInfoBean.contentActivities}" var="contentActivity"
                               itemLabel="#{contentActivity.name}" itemValue="#{contentActivity.id}"/>
            </p:selectOneMenu>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="url" value="跳转链接"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="url" value="#{firstPartyTagInfoBean.$.url}" disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="position" value="排列位置"/>
        </div>
        <div class="ui-g-4">
            <p:spinner id="position" value="#{firstPartyTagInfoBean.$.position}"
                       disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="summary" value="活动描述"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="summary" value="#{firstPartyTagInfoBean.$.summary}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="advantageTag" value="产品优势(多值输入)"/>
        </div>
        <div class="ui-g-4">
            <p:chips id="advantageTag" value="#{firstPartyTagInfoBean.$.advantage}"
                     disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="rate" value="参考利率"/>
        </div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="rate" value="#{firstPartyTagInfoBean.$.rate}"
                             disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon"> <h:outputText value="%"/>
				</span>
            </div>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="loanLimit" value="预计放款额度"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="loanLimit" value="#{firstPartyTagInfoBean.$.loanLimit}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="initCount" value="初始申请人数"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="initCount" value="#{firstPartyTagInfoBean.$.initCount}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="successCount" value="成功申请人数"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="successCount" value="#{firstPartyTagInfoBean.$.successCount}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="lendDate" value="批款时间"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="lendDate" value="#{firstPartyTagInfoBean.$.lendDate}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="heat" value="贷款热度"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="heat" value="#{firstPartyTagInfoBean.$.heat}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="passRate" value="审批通过率"/>
        </div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="passRate" value="#{firstPartyTagInfoBean.$.passRate}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon"> <h:outputText value="%"/>
				</span>
            </div>
        </div>

        <div class="ui-g-2">备注</div>
        <div class="ui-g-10">
            <p:inputTextarea id="remark" value="#{firstPartyTagInfoBean.$.remark}"
                             disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel value="活动缩略图(1:1)"/>
        </div>
        <div class="ui-g-1">
            <p:graphicImage url="#{firstPartyTagInfoBean.$.logo}" width="80"/>
        </div>
        <div class="ui-g-3">
            <p:fileUpload fileUploadListener="#{firstPartyTagInfoBean.onUploadLogo}" mode="advanced" fileLimit="1"
                          auto="true" fileLimitMessage="只能上传一个文件" invalidFileMessage="不支持上传文件类型"
                          invalidSizeMessage="文件过大" sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                          allowTypes="/(\.|\/)(#{constants:get('UPLOAD_FILE_SUFFIX')})$/" label="上传" update="@form"
                          process="@form" disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>
        <div class="ui-g-2">
            <p:outputLabel value="营销标签(1:1)"/>
        </div>
        <div class="ui-g-1">
            <p:graphicImage url="#{firstPartyTagInfoBean.$.marketTag}" width="80"/>
        </div>
        <div class="ui-g-3">
            <p:fileUpload fileUploadListener="#{firstPartyTagInfoBean.onUploadMarketTag}" mode="advanced" auto="true"
                          fileLimit="1" fileLimitMessage="只能上传一个文件" invalidFileMessage="不支持上传文件类型"
                          invalidSizeMessage="文件过大" sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                          allowTypes="/(\.|\/)(#{constants:get('UPLOAD_FILE_SUFFIX')})$/" label="上传" update="@form"
                          process="@form" disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-12">
            <h3>
                <b>营销登录信息</b>
            </h3>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="loginType" value="登录方式"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneButton id="loginType" value="#{firstPartyTagInfoBean.$.loginType}"
                               disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemValue="0" itemLabel="API方式"/>
                <f:selectItem itemValue="1" itemLabel="联登方式"/>
                <p:ajax event="change" process="@form" update="@form"/>
            </p:selectOneButton>
        </div>
        <div class="ui-g-6"></div>
        <h:panelGroup rendered="#{firstPartyTagInfoBean.$.loginType == 0}">
            <div class="ui-g-2">
                <p:outputLabel value="API序号"/>
            </div>
            <div class="ui-g-4">
                <p:selectOneMenu id="apiSeria" value="#{firstPartyTagInfoBean.$.api}" filter="true"
                                 filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                    <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.API_SERIAL]}" var="dic"
                                   itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                </p:selectOneMenu>
            </div>

            <div class="ui-g-2">
                <p:outputLabel for="apiActivity" value="API模板"/>
            </div>
            <div class="ui-g-4">
                <p:selectOneMenu id="apiActivity" value="#{firstPartyTagInfoBean.$.apiModelId}" filter="true"
                                 filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                    <f:selectItems value="#{firstPartyTagInfoBean.apiActivities}" var="apiActivity"
                                   itemLabel="#{apiActivity.apiName}" itemValue="#{apiActivity.id}"/>
                </p:selectOneMenu>
            </div>
        </h:panelGroup>
        <h:panelGroup rendered="#{firstPartyTagInfoBean.$.loginType == 1}">
            <div class="ui-g-2">
                <p:outputLabel for="unionSeria" value="联登序号"/>
            </div>
            <div class="ui-g-4">
                <p:selectOneMenu id="unionSeria" value="#{firstPartyTagInfoBean.$.unionType}" filter="true"
                                 filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                    <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.UNION_SERIAL]}" var="dic"
                                   itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                </p:selectOneMenu>
            </div>

            <div class="ui-g-2">
                <p:outputLabel for="unionInfo" value="联登信息"/>
            </div>
            <div class="ui-g-4">
                <p:selectOneMenu id="unionInfo" value="#{firstPartyTagInfoBean.$.infoType}" filter="true"
                                 filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                    <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.UNION_INFO]}" var="dic"
                                   itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                </p:selectOneMenu>
            </div>
        </h:panelGroup>
    </div>
</ui:composition>